<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="../../common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>${content_tittle}</title>
<link href="${css_ctx}/style_login.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript">
         function del(){
			 if(!window.confirm('是否要删除数据?? '+ '\n' + '注意数据删除后将无法恢复'))
				return false;
		 }
    </script>
</head>

<body class="main_m"> 
<!-- main_title -->
<div class="main_title">
  <h3>${content_tittle}</h3>
  <c:remove var="content_tittle" scope="session"/>
</div>
<!-- End of main_title -->

<!-- 提示信息 -->
<c:if test="${!empty msg}">
   <div class="box ${msgrank}">${msg}</div>
   <c:remove var="msg" scope="session"/>
</c:if>
<!-- End of 提示信息 -->

<!--主体内容-->
<div class="">
  <table class="stylized full">
    <caption> <div class="tab_add"><a href="classroom.do?cmd=classroomInput&roomid=0">添加新教室</a></div></caption>
    <thead>
        <tr>
            <th>序号</th>
            <th>教室名</th>
            <th>最大人数</th>
            <th>备注</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
      <c:if test="${empty pm}">
		<tr><td colspan="5">没有找到相应的记录</td></tr>
	  </c:if>
	  <c:if test="${!empty pm}">
		<c:forEach items="${pm}" var="classroom" varStatus="status">
        <tr bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FFFFAA';" onMouseOut="javascript:this.bgColor='#FFFFFF';">
            <td>[${status.count}]</td>
            <td><strong>${classroom.roomname}</strong></td>
            <td>${classroom.maxnum}</td>
            <td id="content"><a href="#" onclick = 'sm("d${classroom.roomid}") '>备注</a></td>
            <td>
            <a href="${ctx}/classroom.do?cmd=classroomInput&roomid=${classroom.roomid}">修改</a> | 
            <a href="${ctx}/classroom.do?cmd=deleteClassroom&roomid=${classroom.roomid}" onclick="return del();">删除</a>
            </td>
            
        </tr>
       </c:forEach>
	</c:if> 
    </tbody>
    <tfoot>
        <tr>
            <td colspan="5">

	footer

			</td>
        </tr>
    </tfoot>
    </table>
<!--弹出框-->
<div id="alert"> 
  <div class="hh"><span>教室说明</span><span id="close">关闭</span></div> 
  <div class="conz" id="cont">
	<c:if test="${!empty pm}">
	<c:forEach items="${pm}" var="classroom" varStatus="status">
	<div  style="display:none;" id="d${classroom.roomid}">
	  <div style="font-weight:bold; color:#1D3232; height:20px" >教室【${classroom.roomname}】的说明：</div>
	  <div>${classroom.remarks}</div>
	</div>
	</c:forEach>
	</c:if>
  </div>
</div>
<!--弹出框 end-->

</div>
<!-- End of 主体内容 -->
<!-- footer -->
<div id="footer_main">
    <%@ include file="../base/footer.jsp"%>
</div>
<!-- End of footer -->
<script type="text/javascript"> 
var myAlert1;
var myAlert = document.getElementById("alert"); 
var reg = document.getElementById("content").getElementsByTagName("a")[0]; 
var mClose = document.getElementById("close"); 
 function sm(qq1) 
{ 
myAlert1 = document.getElementById(qq1); 
myAlert1.style.display = "block"; 
myAlert.style.display = "block"; 
myAlert.style.position = "absolute"; 
myAlert.style.top = "50%"; 
myAlert.style.left = "50%"; 
myAlert.style.marginTop = "-150px"; 
myAlert.style.marginLeft = "-300px";
mybg = document.createElement("div"); 
mybg.setAttribute("id","mybg"); 
mybg.style.background = "#000"; 
mybg.style.width = "100%"; 
mybg.style.height = "100%"; 
mybg.style.position = "absolute"; 
mybg.style.top = "0"; 
mybg.style.left = "0"; 
mybg.style.zIndex = "500"; 
mybg.style.opacity = "0.3"; 
mybg.style.filter = "Alpha(opacity=30)"; 
document.body.appendChild(mybg);

document.body.style.overflow = "hidden"; 
}

mClose.onclick = function() 
{ 
myAlert.style.display = "none"; 
mybg.style.display = "none"; 
myAlert1.style.display = "none";
} 
</script>
</body>
</html>
